<template>

  <div>
    <el-row>
      <el-col :span="24"><h1>供应商系统</h1></el-col>
    </el-row>

    <el-row>
      <el-col :span="3">
        <!--导航菜单-->
        <!--class="el-menu--vertical-demo" 默认样式-->
        <!--text-color 字体颜色-->
        <el-menu class="el-menu--vertical-demo" text-color="#fff"
                 default-active="" background-color="#545c64">
          <!--index="1"当前菜单的位置-->
          <!--el-sub-menu一级菜单-->
          <el-sub-menu index="0">
            <template #title>
              <el-icon>
                <location/>
              </el-icon>
              <span>首页</span>
            </template>
            <!--el-menu-item二级菜单-->
<!--            <el-menu-item index="0-1" @click="home()">首页</el-menu-item>-->
            <el-menu-item index="0-1" @click="earth()">首页</el-menu-item>

          </el-sub-menu>
          <el-sub-menu index="1">
            <template #title>
              <el-icon>
                <location/>
              </el-icon>
              <span>商品管理</span>
            </template>
            <!--el-menu-item二级菜单-->
            <el-menu-item index="1-1" @click="SQE()" >商品维护</el-menu-item>
<!--            <el-menu-item index="1-2" @click="CustomerManagement()" >客户管理</el-menu-item>-->
          </el-sub-menu>
          <el-sub-menu index="2">

            <template #title>
              <el-icon>
                <location/>
              </el-icon>
              <span>中标和供货管理</span>
            </template>
            <el-menu-item index="2-1" @click="PurchaseReceipt" >中标标书查询</el-menu-item>
            <el-menu-item index="2-2" @click="PurchaseInformationQuery">供货订单</el-menu-item>
          </el-sub-menu>
          <el-sub-menu index="3">
            <template #title>
              <el-icon>
                <location/>
              </el-icon>
              <span>采购标书和供货管理</span>
            </template>
            <!--el-menu-item二级菜单-->
            <el-menu-item index="3-1" @click="SalesIssue()" >采购标书报价</el-menu-item>
            <el-menu-item index="3-2" @click="SalesInformationQuery()" >报价订单查询</el-menu-item>
          </el-sub-menu>
          <el-sub-menu index="4">
            <template #title>
              <el-icon>
                <location/>
              </el-icon>
              <span>退货订单管理</span>
            </template>
            <!--el-menu-item二级菜单-->
            <el-menu-item index="1-1" @click="Stock()">退货订单查询</el-menu-item>
          </el-sub-menu>
<!--          <el-sub-menu index="5">
            <template #title>
              <el-icon>
                <location/>
              </el-icon>
              <span>统计信息</span>
            </template>
            &lt;!&ndash;el-menu-item二级菜单&ndash;&gt;
            <el-menu-item index="5-1" @click="SalesStatistics()" >销售统计</el-menu-item>
            <el-menu-item index="5-2" @click="MonthlySalesStatistics()" >月销售统计</el-menu-item>
          </el-sub-menu>-->

<!--          <el-sub-menu index="6">
            <template #title>
              <el-icon>
                <location/>
              </el-icon>
              <span>售后</span>
            </template>
            &lt;!&ndash;el-menu-item二级菜单&ndash;&gt;
            <el-menu-item index="6-1" @click="userManagement()" >退货查询</el-menu-item>
            <el-menu-item index="6-2" @click="RoleManagement()" >角色管理</el-menu-item>
          </el-sub-menu>-->

<!--          <el-sub-menu index="7">
            <template #title>
              <el-icon>
                <location/>
              </el-icon>
              <span>修改密码</span>
            </template>
            &lt;!&ndash;el-menu-item二级菜单&ndash;&gt;
            <el-menu-item index="7-1" @click="ChangePassword()" >修改密码</el-menu-item>
          </el-sub-menu>-->

<!--          <el-sub-menu index="8">
            <template #title>
              <el-icon>
                <location/>
              </el-icon>
              <span>日志信息</span>
            </template>
            &lt;!&ndash;el-menu-item二级菜单&ndash;&gt;
            <el-menu-item index="8-1" @click="Journal()" >日志一览</el-menu-item>
            <el-menu-item index="8-2" @click="file()" >文件管理</el-menu-item>
          </el-sub-menu>-->
        </el-menu>
      </el-col>
      <el-col :span="21">
        <router-view></router-view>
      </el-col>
    </el-row>
  </div>
</template>


<script>
import axios from "axios";

export default {
  name: "function",
  data() {
    return {
      number: []
    }


  },
  created() {
    axios.post("/api/user/powerById", null).then(res => {
      this.number = res.data

    })
  },
  methods: {
    home() {
      this.$router.push("/Home");
    },
    earth(){
      this.$router.push("/earth");
    },
    SQE() {
      this.$router.push("/SQE");
    },
    CustomerManagement() {
      this.$router.push("/CustomerManagement");
    },
    PurchaseReceipt() {
      this.$router.push("/PurchaseReceipt");
    },
    PurchaseInformationQuery() {
      this.$router.push("/PurchaseInformationQuery");
    },
    SalesIssue() {
      this.$router.push("/SalesIssue");
    },
    SalesInformationQuery() {
      this.$router.push("/SalesInformationQuery");
    },
    Stock() {
      this.$router.push("/Stock");
    },
    SalesStatistics() {
      this.$router.push("/SalesStatistics");
    },
    MonthlySalesStatistics() {
      this.$router.push("/MonthlySalesStatistics");
    },
    userManagement() {
      this.$router.push("/userManagement");
    },
    RoleManagement() {
      this.$router.push("/RoleManagement");
    },
    ChangePassword() {
      this.$router.push("/ChangePassword");
    },
    Journal() {
      this.$router.push("/Journal");
    },
    file(){
      this.$router.push("/file");
    },
    show(num) {

      for (let i = 0; i < this.number.length;i++) {
        if (num == this.number[i]) {

          return true;
        }


      }

        return false



    }
  }
}
</script>

<style scoped>

</style>